package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.SchCourseStudentMapper;
import com.ruoyi.teach.domain.SchCourseStudent;
import com.ruoyi.teach.service.ISchCourseStudentService;

/**
 * 课程关联学生Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class SchCourseStudentServiceImpl implements ISchCourseStudentService 
{
    @Autowired
    private SchCourseStudentMapper schCourseStudentMapper;

    /**
     * 查询课程关联学生
     * 
     * @param stId 课程关联学生主键
     * @return 课程关联学生
     */
    @Override
    public SchCourseStudent selectSchCourseStudentByStId(Long stId)
    {
        return schCourseStudentMapper.selectSchCourseStudentByStId(stId);
    }

    /**
     * 查询课程关联学生列表
     * 
     * @param schCourseStudent 课程关联学生
     * @return 课程关联学生
     */
    @Override
    public List<SchCourseStudent> selectSchCourseStudentList(SchCourseStudent schCourseStudent)
    {
        return schCourseStudentMapper.selectSchCourseStudentList(schCourseStudent);
    }

    /**
     * 新增课程关联学生
     * 
     * @param schCourseStudent 课程关联学生
     * @return 结果
     */
    @Override
    public int insertSchCourseStudent(SchCourseStudent schCourseStudent)
    {
        schCourseStudent.setCreateTime(DateUtils.getNowDate());
        return schCourseStudentMapper.insertSchCourseStudent(schCourseStudent);
    }

    /**
     * 修改课程关联学生
     * 
     * @param schCourseStudent 课程关联学生
     * @return 结果
     */
    @Override
    public int updateSchCourseStudent(SchCourseStudent schCourseStudent)
    {
        schCourseStudent.setUpdateTime(DateUtils.getNowDate());
        return schCourseStudentMapper.updateSchCourseStudent(schCourseStudent);
    }

    /**
     * 批量删除课程关联学生
     * 
     * @param stIds 需要删除的课程关联学生主键
     * @return 结果
     */
    @Override
    public int deleteSchCourseStudentByStIds(Long[] stIds)
    {
        return schCourseStudentMapper.deleteSchCourseStudentByStIds(stIds);
    }

    /**
     * 删除课程关联学生信息
     * 
     * @param stId 课程关联学生主键
     * @return 结果
     */
    @Override
    public int deleteSchCourseStudentByStId(Long stId)
    {
        return schCourseStudentMapper.deleteSchCourseStudentByStId(stId);
    }
}
